const http=require('http')
const app=http.createServer()
app.on('require',(req,res)=>{
    let url=req.url
    if(url=='/'){
        res.end('欢迎')
    }else if(url=='/about'){
        res.end('返回关于页面')
    }else if(url=='/contact'){
        res.end('返回联系页面')
    }
    res.end('错误')
})
app.listen(3000,()=>{
    console.log('server is running...');
})